package com.grad.why.studentsystem.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.grad.why.studentsystem.domain.Studentarrivedinfo;
import com.grad.why.studentsystem.domain.current.*;
import com.grad.why.studentsystem.mapper.StudentarrivedinfoMapper;
import com.grad.why.studentsystem.service.RuntimecoursearrangeinfoService;
import com.grad.why.studentsystem.service.StudentarrivedinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Component
@Service(interfaceClass = StudentarrivedinfoService.class)
@Transactional
public class StudentarrivedinfoServiceImpl implements StudentarrivedinfoService {
    @Autowired
    private StudentarrivedinfoMapper studentarrivedinfoMapper;

    @Override
    public Studentarrivedinfo selectStudentArrivedInfoByRecordIdAndSid(Long rId, Integer sid) {
        try{
            return studentarrivedinfoMapper.selectStudentArrivedInfoByRecordIdAndSid(rId,sid);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public int updateEntity(Studentarrivedinfo studentarrivedinfo) {
        try{
            return studentarrivedinfoMapper.updateByPrimaryKeySelective(studentarrivedinfo);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<CurrentStudentArrivedInfo> getStudentArrivedInfoList(int offset, int limit, String search) {
        try{
            return studentarrivedinfoMapper.getStudentArrivedInfoList(offset,limit,search);
        }catch (Exception E){
            E.printStackTrace();
        }
        return null;
    }

    @Override
    public long getStudentArrivedInfoListLength(String search) {
        try{
            return studentarrivedinfoMapper.getStudentArrivedInfoListLength(search);
        }catch (Exception E){
            E.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<CurrentStudentArrivedRecordeAnalyze> getCurrentStudentArrivedRecordAnalyzeList(int offset, int limit, String search) {
        try{
            return studentarrivedinfoMapper.getCurrentStudentArrivedRecordAnalyzeList(offset,limit,search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public long getCurrentStudentArrivedRecordAnalyzeListLength(String search) {
        try{
            return studentarrivedinfoMapper.getCurrentStudentArrivedRecordAnalyzeListLength(search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<CurrentClassArriveInfos> getCurrentClassArriveInfos(int offset, int limit, String search) {
        try{
            return studentarrivedinfoMapper.getCurrentClassArriveInfos(offset,limit,search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public long getCurrentClassArriveInfosLength(String search) {
        try{
            return studentarrivedinfoMapper.getCurrentClassArriveInfosLength(search);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<CurrentClassArriveInfos> getAllCurrentClassArriveInfos() {
        try{
            return studentarrivedinfoMapper.getAllCurrentClassArriveInfos();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
